<template>
	<view class="ordersucess">
		<nav-bar isBack  :title="title" ></nav-bar>
		<!-- 顶部 -->
		<view v-if="type==1">
			<view class="imx"><image src="../../../static/demo/suess.png"></image></view>
			<view class="order-tit">
				下单成功！
				<text>订单号：{{orderid}}</text>
			</view>
		</view>
		<view v-if="type==0">
			<view class="imx"><image src="../../../static/demo/ons.png"></image></view>
			<view class="order-tit">
				支付失败！
				<text>订单号：{{orderid}}</text>
			</view>
		</view>
		
		<view class="order-btn">
			<text class="ktex" @click="getorder">查看订单</text>
			<text @click="index">返回首页</text>
		</view>
	</view>
</template>

<script>
import navBar from "@/components/navBar/navBar.vue"

export default {
	components: { navBar },
	
	data() {
		return {
           orderid:'',
		   type:'',
		   title:'',
		}
	},
	onLoad(e) {
		this.orderid = e.order_no
		this.type = e.type
		if(this.type==1){
			this.title = '下单成功'
		}else{
			this.title = '下单失败'
		}
	},
	methods: {
		index(){
			uni.navigateTo({
				url:'/pages_now/pages/mall/index/index'
			})
		},
		getorder(){
			uni.navigateTo({
				url:'/pages_now/pages/mall/order/list'
			})
		},
	}
}
</script>

<style lang="scss" scoped>
.ordersucess{
	width: 100%;height: 100vh;background: #fff;display: flex;flex-flow: column;
}
.imx{
	width: 288rpx;
	height: 232rpx;
	margin: 70rpx auto;
}
.order-tit{
	text-align: center;
	font-size: 34rpx;
	padding: 0 30rpx;
	word-wrap: break-word;
	text{
		font-size: 28rpx;
		color: #888;
		display: block;
		margin: 20rpx 0;
	}
}
.order-btn{
	margin-top: 50rpx;
	text-align: center;
	text{
		display: inline-block;
		padding: 15rpx 50rpx;
		background: #C3AB7C;
		color: #fff;
		margin: 0 30rpx;
		border-radius: 5rpx;
	}
	.ktex{
		background:none;
		border:1px #C3AB7C solid;
		color: #C3AB7C;
	}
}
</style>